-module(reverl_util).
-export([error/5, warn/5, info/5, is_pid_alive/1]).

error(Module, LineNo, Pid, Format, Data) ->
    error_logger:error_msg(lists:append("(~p ~p:~p) ", Format), [Pid, Module, LineNo|Data]).

warn(Module, LineNo, Pid, Format, Data) ->
    error_logger:warning_msg(lists:append("(~p ~p:~p) ", Format), [Pid, Module, LineNo|Data]).

info(Module, LineNo, Pid, Format, Data) ->
    error_logger:info_msg(lists:append("(~p ~p:~p) ", Format), [Pid, Module, LineNo|Data]).

is_pid_alive(Pid) 
  when is_pid(Pid) ->
    rpc:call(node(Pid), erlang, is_process_alive, [Pid]).